
// 总控制开关
export interface FilterOption {
    label: string;
    value: string;
    tap?: string;       // 添加可选的 tap 属性
    type?: string;      // 添加可选的 type 属性
    icon?: string;      // 添加可选的 icon 属性
    iconShape?: string; // 添加可选的 iconShape 属性
}

export interface FilterOptions {
    [key: string]: FilterOption[];
}

// 定义装备类型分类
export const equipmentCategories = {
    accessories: ["Amulet", "Ring", "Belt"],
    armour: ["Gloves", "Boots", "Body Armour", "Helmet", "Shield"],
    weapons: {
        melee: ["Sword", "Axe", "Mace", "Staff"],
        ranged: ["Bow", "Wand", "Quiver"],
        small: ["Dagger", "Claw", "Sceptre"]
    }
};

// 定义全局设置的配置类型
export interface GlobalFilterConfig {
    // 基础显示设置
    textColor: string;
    fontSize: number;
    icon: string;
    iconShape: string;
    iconSize: number;

    // 物品属性要求
    minQuality: number;
    maxSize?: {
        width: number;
        height: number;
    };
    itemLevelRange: {
        min: number;
        max?: number;
    };

    // 特殊效果
    playEffect?: boolean;
    minSockets?: number;

    // 过滤优先级
    priority: number;

    // 声音设置
    alertSound?: {
        id: number;
        volume: number;
    };

    // 装备类型过滤
    allowedTypes?: string[];

    // 其他属性要求
    requirements?: {
        minDefense?: number;
        minArmour?: number;
        minEvasion?: number;
        minEnergyShield?: number;
    };
}

// 定义全局设置的配置映射
export const globalFilterConfigs: Record<string, GlobalFilterConfig> = {
    'Normal Items': {
        textColor: '200 200 200',
        fontSize: 36,
        icon: 'White',
        iconShape: 'Circle',
        iconSize: 2,
        minQuality: 15,
        maxSize: { width: 2, height: 3 },
        itemLevelRange: { min: 1, max: 67 },
        priority: 3,
        alertSound: { id: 4, volume: 100 },
        allowedTypes: [...equipmentCategories.accessories, ...equipmentCategories.armour],
        requirements: {
            minDefense: 50,
            minArmour: 100
        }
    },
    'Magic Items': {
        textColor: '136 136 255',
        fontSize: 40,
        icon: 'Blue',
        iconShape: 'Circle',
        iconSize: 1,
        minQuality: 10,
        itemLevelRange: { min: 1, max: 75 },
        priority: 2,
        alertSound: { id: 3, volume: 200 },
        allowedTypes: [
            ...equipmentCategories.accessories,
            ...equipmentCategories.armour,
            ...equipmentCategories.weapons.melee,
            ...equipmentCategories.weapons.ranged
        ],
        requirements: {
            minDefense: 75,
            minArmour: 150,
            minEvasion: 150
        }
    },
    'Rare Items': {
        textColor: '255 255 119',
        fontSize: 45,
        icon: 'Yellow',
        iconShape: 'Star',
        iconSize: 0,
        minQuality: 0,
        itemLevelRange: { min: 60, max: 100 },
        playEffect: true,
        minSockets: 4,
        priority: 1,
        alertSound: { id: 2, volume: 300 },
        allowedTypes: [
            ...equipmentCategories.accessories,
            ...equipmentCategories.armour,
            ...equipmentCategories.weapons.melee,
            ...equipmentCategories.weapons.ranged,
            ...equipmentCategories.weapons.small
        ],
        requirements: {
            minDefense: 100,
            minArmour: 200,
            minEvasion: 200,
            minEnergyShield: 100
        }
    }
};

export const filterTitles: Record<string, string> = {
    currency: "通货",
    equipment: "地图",
    flask: "药剂",
    jewel: "珠宝",
    normalequipment: "普通装备",
    skillgem: "技能宝石",
    unique: "传奇物品",
    misc: "杂项",
    global: "全局设置"
};